<?php
/*
Template Name: Projects
Description: This part is optional, but helpful for describing the Post Template
*/

?>
<?php include 'header.php' ?>
    <body>

<div class="container">

<div class="header">
    <ul>
          <li class="f">
        <div class="logo"> <a href="index.html"><img  src="<?php echo get_template_directory_uri ();?>/images/Mahally-logo.png" /> </a></div>
      </li>
          <li class="f-r">
        <div class="menu ">
              <div class="search f-r">
            <div class="search-warper"> search
                  <input name="search-txt" class="search-txt" id="search" >
                  </textarea>
                </div>
          </div>
              <div class="clearfix"> </div>
              <ul>
              <?php

				$defaults = array(
					'theme_location'  => '',
					'menu'            => '',
					'container'       => 'ul',
					'container_class' => '',
					'container_id'    => '',
					'menu_class'      => 'f',
					'menu_id'         => '',
					'echo'            => true,
					'fallback_cb'     => 'wp_page_menu',
					'before'          => '',
					'after'           => '',
					'link_before'     => '',
					'link_after'      => '',
					'items_wrap'      => '%3$s',
					'depth'           => 0,
					'walker'          => ''
				);
				
				wp_nav_menu( $defaults );
				
				?>
          </ul>
            </div>
      </li>
        </ul>
  </div>
      <ul>
    <li class="f">
          <div class="sidebar f">
        <div class="design"><img src="<?php echo get_template_directory_uri ();?>/images/SHOW-ROOM.png"/> </div>
      </div>
        </li>
    <li class="f-r">
          <div class="projects"> 
        
        <!-- Start photosgallery-std -->
        <div class="sliderkit photosgallery-std">
              <div class="sliderkit-nav">
            <div class="sliderkit-nav-clip">
                  <ul>
                  <?php $content_post = get_post(21);
				  
			// $content_post->post_content; ?> 
				<?php
                //echo $content_post->post_content; 
                // Get the all post content in a variable
                $posttext =  $content_post->post_content; 
                $posttext1 =  $content_post->post_content; 
                 
                // We will search for the src="" in the post content
                $regular_expression = '~src="[^"]*"~';
                $regular_expression1 = '~<img [^\>]*\ />~';
                 
                // WE will grab all the images from the post in an array $allpics using preg_match_all
                preg_match_all( $regular_expression, $posttext, $allpics );
                 
                // Count the number of images found.
                $NumberOfPics = count($allpics[0]);
                 
                // This time we replace/remove the images from the content
                $only_post_text = preg_replace( $regular_expression1, '' , $posttext1);
                /*Only text will be printed*/
                //echo $only_post_text;
                 
                // Check to see if we have at least 1 image
                if ( $NumberOfPics > 0 )
                {
                /* Here you can do what ever you want
                I used http://code.google.com/p/timthumb/ timthumb script to crop all the images and display in thumbnails.
                for that upload the timthumb.php file in your theme folder.
                */
                 
                for ( $i=0; $i < $NumberOfPics ; $i++ )
                {           $str1=$allpics[0][$i];
                $str1=trim($str1);
                $len=strlen($str1);
                $imgpath=substr_replace(substr($str1,5,$len),"",-1);
                //echo $imgpath;
                ?>
                
                
                <li><a href="#" rel="nofollow" title="[link title]"><img src="<?php echo $imgpath;?>"  /></a></li>
                <?php };};
                ?>
                
                
              </ul>
                </div>
            <div class="sliderkit-btn sliderkit-nav-btn sliderkit-nav-prev"><a rel="nofollow" href="#" title="Scroll the carousel to the left"><span>Previous line</span></a></div>
            <div class="sliderkit-btn sliderkit-nav-btn sliderkit-nav-next"><a rel="nofollow" href="#" title="Scroll the carousel to the right"><span>Next line</span></a></div>
          </div>
              <div class="sliderkit-panels">
              <?php $content_post = get_post(21);
			// $content_post->post_content; ?> 
				<?php
                //echo $content_post->post_content; 
                // Get the all post content in a variable
                $posttext =  $content_post->post_content; 
                $posttext1 =  $content_post->post_content; 
                 
                // We will search for the src="" in the post content
                $regular_expression = '~src="[^"]*"~';
                $regular_expression1 = '~<img [^\>]*\ />~';
                 
                // WE will grab all the images from the post in an array $allpics using preg_match_all
                preg_match_all( $regular_expression, $posttext, $allpics );
                 
                // Count the number of images found.
                $NumberOfPics = count($allpics[0]);
                 
                // This time we replace/remove the images from the content
                $only_post_text = preg_replace( $regular_expression1, '' , $posttext1);
                /*Only text will be printed*/
                //echo $only_post_text;
                 
                // Check to see if we have at least 1 image
                if ( $NumberOfPics > 0 )
                {
                /* Here you can do what ever you want
                I used http://code.google.com/p/timthumb/ timthumb script to crop all the images and display in thumbnails.
                for that upload the timthumb.php file in your theme folder.
                */
                 
                for ( $i=0; $i < $NumberOfPics ; $i++ )
                {           $str1=$allpics[0][$i];
                $str1=trim($str1);
                $len=strlen($str1);
                $imgpath=substr_replace(substr($str1,5,$len),"",-1);
                //echo $imgpath;
                ?>
                <div class="sliderkit-panel"> <a href="#" title="[Link title text]"> <img src="<?php echo $imgpath;?>" /></a> </div>
                
                
                <?php };};
                ?>
            
            
          </div>
            </div>
      </div>
        </li>
  </ul>
    </div>
<?php include 'footer.php' ?>
